import { takeEvery } from "redux-saga/effects";
import { AclApi } from "@api";
import { SAGA_LOGOUT } from "./saga-types";
import { asyncRequest } from "@common/saga-helper";

function* logoutSaga() {
  yield takeEvery(SAGA_LOGOUT, function* (action) {
    yield* asyncRequest({
      effects: [
        { api: AclApi.logout, callback: action.payload.callback }
      ]
    });
  });
}

export default [
  logoutSaga()
];